<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<HTML>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link
	href="${ pageContext.request.contextPath }/static/bootstrap-3.3.7-dist/css/bootstrap.min.css"
	rel="stylesheet">
<link href="${pageContext.request.contextPath}/css/Style1.css"
	rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript">
		function edit(csid) {
			window.location.href = "${pageContext.request.contextPath}/admin/adminCategorySecond_edit.action?csid="+csid;
		}
		function fu() {
			window.location.href = "${pageContext.request.contextPath}/admin/adminCategory_findAll.action";
		}
		function deletecs(csid) {
			var r=confirm("确定删除吗？");
			if (r==true){
				window.location.href ="${pageContext.request.contextPath}/admin/adminCategorySecond_delete.action?csid="+csid;
			}
			else{
			}
		}
</script>
<body>
	<div align="right" style="margin-top: 12px; padding-right: 70px;">
		<button type="button" onclick="fu()" class="btn btn-info">返回</button>
	</div>

	<div style="width: 93%; margin-left: 38px;">
		<form style="margin-top: 8px;">
			<table width="100%" align="center" id="table"
				class="table table-hover table-bordered table-striped">
				<thead>
					<tr align="center" bgcolor="#93b6bd">
						<th scope="col" width="30%" style="text-align: center;">种类ID</th>
						<th scope="col" width="30%" style="text-align: center;">二级分类名称</th>
						<th scope="col" style="text-align: center;">操作</th>
					</tr>
				</thead>
				<tbody></tbody>
				<!-- 循环遍历 -->
				<c:forEach items="${categoryList}" var="c">
					<tr align="center">
						<td>${c.csid}</td>
						<td>${c.csname }</td>
						<td><button type="button" class="btn btn-primary btn-sm glyphicon glyphicon-pencil"
								onclick="edit(${c.cid})"></button>&nbsp;&nbsp;&nbsp;
							<button type="button" class="btn btn-danger btn-sm glyphicon glyphicon-trash"
								onclick="deletecs(${c.cid})"></button></td>
					</tr>
				</c:forEach>
			</table>
		</form>
	</div>
</body>
</html>